<?php
require_once 'app/bootstrap.php';

$helper = new Helper_CurrentDate;
$date = $helper->getCurrentDate();

$dbSection = new Model_Resource_SiteResource_Section();
$sections  = $dbSection->fetchAll('resource_id = 1 AND last_read_at >= "' . $date . '"');

require_once APPLICATION_PATH . '/view/page/header.phtml';

?>
<div class="grid_16">
    <?php if ($sections->count()) { ?>
    <ul>
    <?php
    /** @var $item Zend_Db_Table_Row */
    foreach ($sections as $item) {
        ?>
        <li>
            <a href="adverts.php?section=<?php echo $item->id?><?php echo $helper->getQueryString()?>">
            <?php echo $item->section_title?></a>
        </li>
    <?php } ?>
    </ul>
<?php } else { ?>
    <p><?php echo _('No able sections. Try later or select another day.') ?></p>
<?php } ?>
</div>
<div class="grid_16">
    <?php require_once APPLICATION_PATH . '/view/page/date.phtml';?>
</div>
<div class="clear"></div>
